import 'screen_util.dart';

/// 适配
class Screenutil {
  /// 返回ScreenUtil实例对象
  static ScreenUtil _s() => ScreenUtil.getInstance();

  /// 初始化设计尺寸
  /// * [w] double|必填|设计稿宽
  /// * [h] double|必填|设计稿高
  /// * [density] double|选填|*设备比
  static initDesignSize(double w, double h, {double density = 3.0}) =>
      setDesignWHD(w, h, density: density);

  /// 屏幕的宽度
  static double getScreenWidth = _s().screenWidth;

  /// 屏幕的高度
  static double getScreenHeight = _s().screenHeight;

  /// 系统AppBar高度
  static double getAppBarHeight = _s().appBarHeight;

  /// 获取系统状态栏高度
  static double getBarHeight = _s().statusBarHeight;

  /// 适配函（即设计图测量的高度）
  /// * [val] double 高度，宽度，字体尺寸|必填
  static double adapter(double val) => _s().getAdapterSize(val);

  static adapters(int val) => _s().getAdapterSize(val.toDouble());
}
